<template>
    <!-- props , $emit() -->
    <h1>{{ title }}---{{ age }}---{{ likes }}</h1>
    <el-button @click="$emit('changeTxt',txt)" type="danger">changeTxt</el-button>
</template>
<script setup>
import { defineProps , ref } from 'vue'

// props , $emit()
const txt = ref('我是子组件点击按钮后展示的内容')
defineProps({
    title:{
        type: String,
    },
    age:{
        type: Number,
    },
    likes:{
        type: Array,
        default(){return ['90pppp']}
    }
})

</script>
<style lang='scss' scoped></style>
<!--**
 * import { ref } from 'vue'
 * nextTick reactive defineProps defineEmits defineExpose 
 * computed onMounted onUpdated onUnmounted watch watchEffect
 * ** -->